<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>index</title>
</head>
<body>
<%--JSP表达式--%>
<%-- 将程序的输出，输出到客户端 --%>
<%= new Date() %>
<hr/>
<%-- jsp 脚本片段 --%>
<%
    int sum = 0;
    for (int i = 0; i < 100; i++) {
        sum += i;
    }
    out.println("<h1>sum=" + sum + "<h1>");  //输出
%>

<%-- jsp声明 --%>
<%!
    static{
        System.out.println("loading servlet");
    }

    private int globalVar = 0;

    public void aa(){
        System.out.println("进入了方法aa");
    }
%>
</body>
</html>
